print("列表生成式##################################################start")
# 生成[1x1, 2x2, 3x3, ..., 10x10]列表
list = [x * x for x in range(1, 11)]
print(list)
# for循环后面还可以加上if判断
list = [x * x for x in range(1, 11) if x % 2 == 0]
print(list)
# 使用双循环生成列表
list = [x + y for x in "wx" for y in "tyb"]
print(list)
# 使用map生成列表
map = {"name": "wx", "age": "25"}
map = [k + '=' + v for k, v in map.items()]
print(map)
# 把list的内容全部变成小写
L = ["WX", "TYB", "CJF", 2222]
L = [v.lower() for v in L if isinstance(v, str)]
print(L)
print("列表生成式##################################################end\n")
